﻿/* 
* Copyright (c) 2010, The University of Texas at Austin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, 
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, 
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, 
* this list of conditions and the following disclaimer in the documentation and/or other materials 
* provided with the distribution.
*
* Neither the name of The University of Texas at Austin nor the names of its contributors may be 
* used to endorse or promote products derived from this software without specific prior written 
* permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
using Bio.Views.Structure.Editor.Internal.Editing;

namespace Bio.Views.Structure.Editor.Internal.Rendering.Interfaces
{
    public interface IStructureElementVisualComponent
    {
        IStructureElementVisualComponent ParentComponent { get; set; }
        FontFamily NucleotideFontFamily { get; set; }
        FontWeight? NucleotideFontWeight { get; set; }
        FontStyle? NucleotideFontStyle { get; set; }
        double? NucleotideFontSize { get; set; }
        Brush NucleotideFill { get; set; }
        char? NucleotideSubstitution { get; set; }
        bool? IsNucleotideSubstituted { get; set; }

        double? NucleotideCircleDiameter { get; set; }
        double? NucleotideCircleEdgeThickness { get; set; }
        bool? NucleotideCircleIsFilled { get; set; }
        Brush NucleotideCircleFill { get; set; }
        Brush NucleotideCircleStroke { get; set; }

        NucleotideRenderingMode? NucleotideRenderingStyle { get; set; }

        bool? BasePairConnectorIsFilled { get; set; }
        bool? BasePairConnectorIsVisible { get; set; }
        Brush BasePairConnectorFill { get; set; }
        Brush BasePairConnectorStroke { get; set; }
        double? BasePairConnectorSize { get; set; }
        double? BasePairConnectorStrokeThickness { get; set; }

        BasePairConnectorRenderingMode? BasePairConnectorRenderingStyle { get; set; }

        bool IsNucleotideFillInheriting();
        bool IsNucleotideCircleFillInheriting();
        bool IsNucleotideCircleStrokeInheriting();

        bool IsBasePairConnectorFillInheriting();
        bool IsBasePairConnectorStrokeInheriting();

        bool IsComponentVisible { get; set; }
        Visual VisualComponent { get; }
        IEnumerable<IStructureElementVisualComponent> Children { get; }
        IEnumerable<int> NucleotideIndices { get; }

        void PropagateVisualPropertyChanged();
        //void PropagateNucleotideVisualPropertyChanged();
        //void PropagateBasePairVisualPropertyChanged();

        void AddChild(IStructureElementVisualComponent component);
        void RemoveChild(IStructureElementVisualComponent component);
        void NotifyParentHierarchyChanged();
        bool HitTest(Point point, bool includeChildren);
        void MakeSelectable();
        void MakeUnselectable();
        void Select(bool showNucleotideStrandConnectors);
        void Deselect();
        void ContextuallySelect();
        void ContextuallyDeselect();
        Visual MakeVisualSnapshot();

        void StartEditTracking();
        void InterruptEditTracking();
        void UninterruptEditTracking();
        void ApplyPropertyEditSet(StructureElementPropertyChangeSet set, bool interruptEditTracking);
        void UndoAllPropertyChanges();
        void UndoLastPropertyChange();
        object SaveProperties();
        bool IsDirty();
    }
}
